In digital image processing, it is sometimes desirable, in what is known as a segmentation process, to separate some form of structure from a background in a digital gray-scale image. This can be done by what is known as thresholding or binarization, in which the luminance values of the pixels of the digital image are compared to a threshold value. For example, luminance values above the threshold value may be set to 1, while luminance values below the threshold value may be set to 0, or vice versa. With a well-chosen threshold value, the binarization results in a binary image with demarcated, real structures.
In a simple form of binarization, one and the same threshold value is used for the whole image. Alternatively, use is made of a threshold matrix with a threshold value for each of a number of partial areas in the image. In both cases, the threshold value(s) can be calculated on the basis of the luminance values of the digital image which is to be thresholded, for example in order to take account of luminance variations between images in a sequence of images and/or luminance variations within a particular image.
In many cases, a sequence of images is processed in a number of steps. One of the introductory steps can be the above-mentioned binarization, which aims on the one hand to locate relevant structures and on the other hand to reduce the amount of data which is processed in subsequent steps. Of course, it is desirable for the binarization to be carried out with high precision, because errors will otherwise be able to propagate in subsequent processing steps. In most cases, unfortunately, high precision can only be achieved at the cost of relatively time-consuming and memory-intensive calculations.
The above considerations have to be taken into account, for example, when calculating data, such as positions, starting from images of a pattern on a base. The pattern contains mutually distinct symbols whose shape and/or relative location code said data. The images can, for example, be recorded optically by a sensor in a hand-held apparatus, for example in the form of a pen. Such an apparatus for position determination is described, for example, in U.S. Pat. Nos. 5,051,736, 5,477,012, WO 00/73983 and U.S. Pat. No. 6,208,771B1. Here, data is calculated as positions which reflect the movement of the apparatus across the base and therefore can be used to create an electronic version of handwritten information.
The above-mentioned images can be processed in a data-processing unit, such as a suitably programmed microprocessor, an ASIC, an FPGA, etc., which receives a sequence of digital gray-scale images, binarizes these for identification of the above-mentioned symbols, and calculates a position on the basis of each binarized image. During the binarization, a threshold matrix is used which contains a threshold value for each pixel in the gray-scale image. For example, each image may contain approximately 100×100 pixels and have 8-bit resolution in luminance. Recording of handwritten information should be carried out at high temporal resolution, typically approximately 50-100 images per second, for which reason it is difficult to combine requirements for high precision in the binarization with requirements for rapid processing and small memory requirement, even in a specially-adapted data processing unit.
In most cases, the images additionally contain interferences, for example in the form of noise, lack of sharpness, uneven illumination and geometric distortion, making the identification of symbols or objects still more difficult.